package com.gsn.poker.play;

import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.gsn.engine.myplay.GsnGame;
import com.gsn.poker.asset.PokerTexture;

public class ChipRandomGroup extends Group {
	ChipGroupLogic logic = new ChipGroupLogic();
	public ChipRandomGroup(long money) {
		transform = GsnGame.transform;
		logic.convertMoneyToChip(money);
		float coinWid = PokerTexture.inst().chip.get(0).getRegionWidth();
		float coinHei = PokerTexture.inst().chip.get(0).getRegionHeight();
		this.width = coinWid * 2;
		this.height = coinHei * 2;
		for (int i = 0; i < logic.finalChipList.size(); i++){
			int type = ChipGroupLogic.getType(logic.finalChipValueList.get(i));
			for (int j = 0; j < logic.finalChipList.get(i); j++){
				Image img = new Image(PokerTexture.inst().chip.get(type % 5));
				img.x = this.width * (float)(Math.random());
				img.y = this.height * (float)(Math.random());
				addActor(img);
			}
		}
	}
}
 